package org.nf.trading.service.app.user;


import com.github.pagehelper.Page;
import com.github.pagehelper.PageInfo;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import org.nf.trading.dto.ChatMessageDTO;
import org.nf.trading.dto.CommentMessageDTO;
import org.nf.trading.dto.MessageDTO;
import org.nf.trading.dto.UserDTO;
import org.nf.trading.entity.User;

import java.util.List;

public interface UserService {
    /**
     * 通过手机号和密码验证
     * @param phone
     * @param pwd
     * @return
     */
    UserDTO loginAuthPwd(String phone,String pwd,HttpServletRequest request);

    /**
     * 生成验证码
     * @param phone
     * @return
     */
    void generateCode(String phone);

    /**
     *  验证登录，返回token
     */
    UserDTO loginAuth(String phone,String code);

    /**
     * 注册用户
     * @param user
     * @return
     */
    String register(User user);

    /**
     * 通过id查询用户
     * @param uId
     * @return
     */
    User selectByPrimaryKey(Integer uId);

    /**
     * 查询所有的用户信息
     * @param pageNum
     * @param pageSize
     * @param userName
     * @return
     */
    PageInfo<User> selectUserAll(Integer pageNum,Integer pageSize,String userName,String phone);

    List<CommentMessageDTO> listUser(MessageDTO[] users);
}
